<template>
  <div class="from_box">
    <form action="">
      <input type="text"  placeholder="请输入昵称" v-model="formMess.account">
      <input type="password" placeholder="请输入密码" v-model="formMess.act_pwd">
      <input type="text" placeholder="请输入手机号" v-model="formMess.phone">
    </form>
    <span class="but" @click="onSubmit()">提交</span>
  </div>
</template>
<script>
import axios from 'axios';
 
export default {
  name:'Itmo',
  data() {
    return {
        formMess:{
        "account":"",
        "act_pwd":"",
        "phone":""
    }
    };
  },
  methods: {
    onSubmit() {
      let formData = new FormData();
      for(var key in this.formMess){undefined
        formData.append(key,this.formMess[key]);
      }
 
        axios({
        method:"post",
        url:"http://localhost:8080/",
        headers: {
          "Content-Type": "multipart/form-data"
        },
        withCredentials:true,
        data:formData
    }).then((res)=>{
            console.log(res);
        });
    }
  }
};
</script>
<style lang="less">
        .but{
            display: block;
            background: seagreen;
        }
</style>
